package com.example.datamanage.common;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 28142
 * @description 数据库类型枚举类
 * @date 2023/7/25 9:23
 */
@Getter
public enum DataTypeEnum {
    /**
     * mysql
     */
    MYSQL("mysql"),
    /**
     * clickhouse
     */
    CLICKHOUSE("clickhouse"),
    /**
     * sqlserver
     */
    SQL_SERVER("sqlserver"),
    /**
     * postgresql
     */
    POSTGRESQL("postgresql");
    private String type;

    DataTypeEnum(String type) {
        this.type = type;
    }

    public static List<Map<String, Object>> getDataTypeEnum() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (DataTypeEnum value : DataTypeEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("label", value.getType());
            map.put("value", value.getType());
            list.add(map);
        }
        return list;
    }

}
